<?php
MYTCONN();
form_pr('Wmquery', '', '', 'post');

if (!isset($_GET['ACT'])) {
    $form_action = 'view/remittancegrid';
} elseif ($_GET['ACT'] == '1') {
    $form_action = 'view/acti_CL_dup';
} elseif ($_GET['ACT'] == '2') {
    $form_action = 'view/acti_blk';
} elseif ($_GET['ACT'] == '3') {
    $form_action = 'view/acti_blkorder';
} elseif ($_GET['ACT'] == '4') {
    $form_action = 'view/acti_stchg';
}
$print_string = '';
if ($_GET['QID'] == 'OR1') {
    $print_name =  'Numero de Operacao ';
    $OBCJ = 'OR';
    $SearchParam['name'] = 'FraID';
    $SearchParam['fieldsize'] = '10';
    $SearchParam['fieldmax'] = '10';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'OR2') {
    $print_name =  'Numero de Remessa: ';
    $OBCJ = 'OR';
    $SearchParam['name'] = 'FraReferenciaAg';
    $SearchParam['fieldsize'] = '11';
    $SearchParam['fieldmax'] = '11';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'OR3') {
    $print_name =  'Cliente da Operacao: ';
    $OBCJ = 'OR';
    $SearchParam['name'] = 'FraCliNumero';
    $SearchParam['fieldsize'] = '10';
    $SearchParam['fieldmax'] = '10';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'OR4') {
    $print_name =  'Data da Operacao: ';
    $OBCJ = 'OR';
    $SearchParam['name'] = 'FraFechaIngreso';
    $SearchParam['fieldsize'] = '10';
    $SearchParam['fieldmax'] = '10';
    $SearchParam['fieldtype'] = 'date';
} elseif ($_GET['QID'] == 'OR5') {
    $print_name =  'Beneficiario da Operacao: ';
    $OBCJ = 'OR';
    $SearchParam['name'] = 'FraBnfNumero';
    $SearchParam['fieldsize'] = '10';
    $SearchParam['fieldmax'] = '10';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'CL1') {
    $print_name =  'Numero do Cliente: ';
    $OBCJ = 'CL';
    $SearchParam['name'] = 'CliNumero';
    $SearchParam['fieldsize'] = '10';
    $SearchParam['fieldmax'] = '10';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'CL2') {
    $print_name =  'Nome do Cliente: ';
    $OBCJ = 'CL';
    $SearchParam['name'] = 'CliNombre';
    $SearchParam['fieldsize'] = '40';
    $SearchParam['fieldmax'] = '40';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'CL3') {
    $print_name =  'Contacto do Cliente: ';
    $OBCJ = 'CL';
    $SearchParam['name'] = 'CliTelefono';
    $SearchParam['fieldsize'] = '10';
    $SearchParam['fieldmax'] = '10';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'CL4') {
    $print_name =  'Data de Nascimento do Cliente: ';
    $OBCJ = 'CL';
    $SearchParam['name'] = 'CliFechaNacimiento';
    $SearchParam['fieldsize'] = '10';
    $SearchParam['fieldmax'] = '10';
    $SearchParam['fieldtype'] = 'date';
} elseif ($_GET['QID'] == 'CL5') {
    $print_name =  'Numero do Documento do Cliente: ';
    $OBCJ = 'CL';
    $SearchParam['name'] = 'dtd_Numero';
    $SearchParam['fieldsize'] = '10';
    $SearchParam['fieldmax'] = '10';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'CL6') {
    $print_name =  'Numero do Beneficiario: ';
    $OBCJ = 'CL';
    $SearchParam['name'] = 'uniBeneficiario';
    $SearchParam['fieldsize'] = '10';
    $SearchParam['fieldmax'] = '10';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'CL7') {
    $print_name =  'Nome do Beneficiario: ';
    $OBCJ = 'CL';
    $SearchParam['name'] = 'BnfNombre';
    $SearchParam['fieldsize'] = '40';
    $SearchParam['fieldmax'] = '40';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'RC1') {
    $print_name =  'Numero de Beneficiario: ';
    $OBCJ = 'RC';
    $SearchParam['name'] = 'BnfNumero';
    $SearchParam['fieldsize'] = '10';
    $SearchParam['fieldmax'] = '10';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'RC2') {
    $print_name =  'Beneficiario por Cliente: ';
    $OBCJ = 'RC';
    $SearchParam['name'] = 'CliNumero';
    $SearchParam['fieldsize'] = '10';
    $SearchParam['fieldmax'] = '10';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'RC3') {
    $print_name =  'Nome do Beneficiario: ';
    $OBCJ = 'RC';
    $SearchParam['name'] = 'BnfNombre';
    $SearchParam['fieldsize'] = '40';
    $SearchParam['fieldmax'] = '40';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'RC4') {
    $print_name =  'Contacto do Beneficiario: ';
    $OBCJ = 'RC';
    $SearchParam['name'] = 'BnfTelefono';
    $SearchParam['fieldsize'] = '10';
    $SearchParam['fieldmax'] = '10';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'AC1') {
    $print_name =  'Numero da Conta: ';
    $OBCJ = 'AC';
    $SearchParam['name'] = 'cb_Id';
    $SearchParam['fieldsize'] = '10';
    $SearchParam['fieldmax'] = '10';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'AC2') {
    $print_name =  'Beneficiario da Conta: ';
    $OBCJ = 'AC';
    $SearchParam['name'] = 'cb_Beneficiario';
    $SearchParam['fieldsize'] = '10';
    $SearchParam['fieldmax'] = '10';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'DP1') {
    $print_name =  'Data^Valor: ';
    $OBCJ = 'DP';
    $SearchParam['name'] = 'ref';
    $SearchParam['fieldsize'] = '10';
    $SearchParam['fieldmax'] = '10';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'EX1') {
    $print_name =  'Operacao de Exchange: ';
    $OBCJ = 'EX';
    $SearchParam['name'] = 'ref';
    $SearchParam['fieldsize'] = '10';
    $SearchParam['fieldmax'] = '10';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'EX2') {
    $print_name =  'Remessa de Exchange: ';
    $OBCJ = 'EX';
    $SearchParam['name'] = '';
    $SearchParam['fieldsize'] = '10';
    $SearchParam['fieldmax'] = '10';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'EX3') {
    $print_name =  'Cliente de Exchange: ';
    $OBCJ = 'EX';
    $SearchParam['name'] = 'CliNumero';
    $SearchParam['fieldsize'] = '10';
    $SearchParam['fieldmax'] = '10';
    $SearchParam['fieldtype'] = 'text';
} elseif ($_GET['QID'] == 'EX4') {
    $print_name = 'Data da Operacao: ';
    $OBCJ = 'EX';
    $SearchParam['name'] = 'Time';
    $SearchParam['fieldsize'] = '10';
    $SearchParam['fieldmax'] = '10';
    $SearchParam['fieldtype'] = 'text';
}
$print_string .= '<div style="padding:20px">'.$print_name;
mn_field('hidden', 'ED', 'OBCJ', $OBCJ, '', '', '', '');
mn_field('hidden', 'ED', 'SearchParam', $SearchParam['name'], '', '', '', '');
mn_field($SearchParam['fieldtype'], 'ED', 'SearchValue', '', $SearchParam['fieldmax'], $SearchParam['fieldsize'], '', '');
$print_string .= '</div>';
$print_string .= '<div style="padding:20px">';
mn_field('button', 'ED', 'SearchExec', 'Consultar', '', '', '', '" onclick="
		document.Wmquery.action=\'_response/call.php?get=Operative/' . $form_action . '\';
		Ext.onReady(function(){idtargetwindow(\'Resultados da Consulta\',\'qwinResults\',\'Wntargett\',800,260);});
		subform(\'Wmquery\',\'Wntargett\');');
$print_string .= '</div>';
$print_string .= '<div id="q_msg"></div>';
echo $print_string;